<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePropertiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('properties', function (Blueprint $table) {
            $table->increments('id');
//            $table->integer('category_id')->comment('分类id');
            $table->integer('province')->unsigned()->nullable()->comment('省id');
            $table->string('provincename')->nullable()->comment('省');
            $table->integer('region')->unsigned()->nullable()->comment('楼盘所属区域');
            $table->string('regionname')->nullable()->comment('楼盘所属区域名称');
            $table->integer('area')->unsigned()->nullable()->comment('区id');
            $table->string('areaname')->nullable()->comment('区/县');
            $table->integer('town_id')->unsigned()->nullable()->comment('镇id');
            $table->string('town')->nullable()->comment('镇');
            $table->integer('metro_id')->unsigned()->nullable()->comment('地铁线id');
            $table->integer('metro_station_id')->unsigned()->nullable()->comment('地铁站id');
            $table->string('title')->comment('楼盘名称');
            $table->float('average')->nullable()->comment('楼盘均价');
            $table->string('average_unit')->nullable()->default('元/㎡')->comment('均价单位');
            $table->float('openprice')->nullable()->comment('开盘价格');
            $table->string('openprice_unit')->nullable()->default('元/㎡')->comment('单位');
            $table->float('payment')->nullable()->comment('最低首付');
            $table->string('payment_unit')->nullable()->default('元/㎡')->comment('单位');
            $table->integer('opentime')->nullable()->comment('开盘时间');
            $table->string('hasopen')->nullable()->comment('已开盘楼盘');
            $table->integer('handtime')->nullable()->comment('交房时间');
            $table->string('hashand')->nullable()->comment('已交房楼盘');
            $table->string('map')->nullable()->comment('地图标注');
            $table->string('longitude')->nullable()->comment('经度');
            $table->string('latitude')->nullable()->comment('纬度');
            $table->string('price')->nullable()->comment('价格区间');
            $table->string('apartment')->nullable()->comment('户型');
            $table->string('developer')->nullable()->comment('开发商');
            $table->string('feature')->nullable()->comment('特色');
            $table->string('featuretxt')->nullable()->comment('特色名称');
            $table->string('salestatus')->nullable()->default('T')->comment('销售状态：T 在售 F 停售 W 待售');
            $table->integer('renovation_id')->unsigned()->nullable()->comment('装修情况id');
            $table->string('renovation')->nullable()->comment('装修情况');
            $table->string('address')->nullable()->comment('楼盘地址');
            $table->string('saleaddress')->nullable()->comment('售楼处地址');
            $table->string('saletel')->nullable()->comment('售楼处电话');
            $table->string('presale')->nullable()->comment('预售证号');
            $table->string('thumb')->nullable()->comment('缩略图');
            $table->string('images')->nullable()->comment('相册');
            $table->text('recommend')->nullable()->comment('推荐位');
            $table->string('status')->comment('状态：T 启用 F 禁用');
            $table->string('mianji')->nullable()->comment('建筑面积');
            $table->integer('wytype')->unsigned()->nullable()->comment('物业类型');
            $table->string('wyname')->nullable()->comment('物业类型名');
            $table->string('ghmianji')->nullable()->comment('规划面积');
            $table->string('jztype')->nullable()->comment('建筑类别');
            $table->string('zxstatus')->nullable()->comment('装修情况');
            $table->string('proright')->nullable()->comment('产权');
            $table->string('hnum')->nullable()->comment('总户数');
            $table->string('dnum')->nullable()->comment('总栋数');
            $table->string('rongjilv')->nullable()->comment('容积率');
            $table->string('lvhua')->nullable()->comment('绿化率');
            $table->string('carnum')->nullable()->comment('车位');
            $table->string('wycompany')->nullable()->comment('物业公司');
            $table->string('propertyfee')->nullable()->comment('物业费');
            $table->string('face')->nullable()->comment('楼盘朝向');
            $table->string('design')->nullable()->comment('建筑设计单位');
            $table->string('traffic')->nullable()->comment('交通');
            $table->string('school')->default('学校')->nullable()->comment('学校');
            $table->string('shopping')->default('购物')->nullable()->comment('购物');
            $table->string('hospital')->default('医院')->nullable()->comment('医院');
            $table->string('life')->default('生活')->nullable()->comment('生活');
            $table->string('recreation')->default('娱乐')->nullable()->comment('娱乐');
            $table->string('restaurant')->default('餐饮')->nullable()->comment('餐饮');
            $table->string('merit')->nullable()->comment('楼盘优点');
            $table->string('defect')->nullable()->comment('楼盘缺点');
            $table->text('content')->nullable()->comment('项目介绍');
            $table->string('seotitle')->nullable()->comment('seo标题');
            $table->string('keywords')->nullable()->comment('seo关键词');
            $table->string('description')->nullable()->comment('seo描述');
            $table->integer('follow')->default(0)->nullable()->comment('关注数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('properties');
    }
}
